<script language="javascript">
$(document).ready(function() {
    $("#1,#2,#3,#4,#5,#6,#7").keyup(function(e) {
        
    //lay gia tri tu input
      var j = new Array();
      for(var i = 1; i<=7;i++){
          if(!($("#"+i).val())){
              j[i]="null"; 
          }
          else {
              j[i]= $("#"+i).val();
          }   
          //console.log(j[i]);
      }
      if(e.keyCode == 13){
        //call get method
         $('#searchrsx').hide();
               $('#searchload').fadeIn(1000).fadeOut(100);
               $('#searchrs').load( 
                   "../search/" +  j[1] + "/" + j[2] + "/" + j[3] + "/" + j[4] + "/" + j[5] + "/" + j[6] + "/" + j[7]
                   , function () {                         
                    $(this).show();
                   }); 
            } 
        });
});
</script>
<div class="z1ttsvs index">
	<h2><?php __('Thông tin đoàn viên chi đoàn '.$chidoan[0] ['chidoansvs'] ['tenchidoan']);?></h2>
	<table cellpadding="0" cellspacing="0" id="tables">
	<tr>
            <th class="actions"><?php __('Lựa chọn');?></th>
			<th><?php echo 'STT';?></th>
			<th><?php echo 'MSSV';?></th>
            <th><?php echo 'Họ tên';?></th>
            <th><?php echo 'Phái';?></th>
            <th><?php echo 'Tôn giáo';?></th>
            <th><?php echo 'Tỉnh TP';?></th>
            <th><?php echo 'Quận huyện';?></th>
            <th><?php echo 'Phường xã';?></th>
			<th><?php echo 'Ngày sinh';?></th>
			<th><?php echo 'Nơi sinh';?></th>
			<th><?php echo 'Địa chỉ';?></th>
			<th><?php echo 'SĐT';?></th>
			<th><?php echo 'Email';?></th>
			<th><?php echo 'Dân tộc';?></th>
			<th><?php echo 'Vào đoàn';?></th>
			<th><?php echo 'Vào đảng';?></th>
			<th><?php echo 'TT đoàn';?></th>
			<th><?php echo 'Ngày vào CĐ';?></th>	
	</tr>
    <tr>
            <td></td>
            <td></td>
             <td><?php echo $this->Form->input(1,array('label'=>'','id'=>1));?></td>
             <td><?php echo $this->Form->input(2,array('label'=>'','id'=>2));?></td>
             <td><?php echo $this->Form->input(3,array('label'=>'','id'=>3));?></td>
             <td><?php echo $this->Form->input(4,array('label'=>'','id'=>4,'options'=>$tongiaos,'empty'=>true));?></td>
             <td><?php echo $this->Form->input(5,array('label'=>'','id'=>5));?></td>
             <td><?php echo $this->Form->input(6,array('label'=>'','id'=>6));?></td>
             <td><?php echo $this->Form->input(7,array('label'=>'','id'=>7));?></td>         
	</tr>
    <tbody id="searchrs"><p style="display: none;" id="searchload">Loading...</p></tbody>
    <tbody id="searchrsx">
	<?php
	$i = 0;
	foreach ($z1ttsvs as $z1ttsv):
		$class = null;
		if ($i++ % 2 == 0) {
			$class = ' class="altrow"';
		}
	?>
	<tr<?php echo $class;?>>
    <td class="actions">
			<?php echo $this->Html->link(__('Sửa', true), array('controller'=>'sinhviens','action' => 'edit', $z1ttsv['Z1ttsv']['id'])); ?>
			
		</td>
		<td><?php echo $i; ?>&nbsp;</td>
		<td><?php echo $z1ttsv['Z1ttsv']['mssv']; ?>&nbsp;</td>
        <td><?php echo $z1ttsv['Z1ttsv']['hoten']; ?>&nbsp;</td>
       	<td><?php echo $z1ttsv['Z1ttsv']['phai']; ?>&nbsp;</td>
        <td>
			<?php echo $z1ttsv['Tongiao']['tentongiao']; ?>
		</td>
        <td>
            <?php echo $z1ttsv['Z1ttsv']['tentinhtp']; ?>&nbsp;
        </td>
        <td><?php echo $z1ttsv['Z1ttsv']['tenquanhuyen']; ?>&nbsp;</td>
        <td><?php echo $z1ttsv['Z1ttsv']['tenphuongxa']; ?>&nbsp;</td>
		<td><?php echo $z1ttsv['Z1ttsv']['ngaysinh']; ?>&nbsp;</td>
		<td><?php echo $z1ttsv['Z1ttsv']['noisinh']; ?>&nbsp;</td>
		<td><?php echo $z1ttsv['Z1ttsv']['diachi']; ?>&nbsp;</td>
		<td><?php echo $z1ttsv['Z1ttsv']['sodienthoai']; ?>&nbsp;</td>
		<td><?php echo $z1ttsv['Z1ttsv']['email']; ?>&nbsp;</td>
		<td>
			<?php echo $z1ttsv['Dantoc']['tendantoc']; ?>
		</td>
		<td><?php echo $z1ttsv['Z1ttsv']['ngayvaodoan']; ?>&nbsp;
            <?php echo $z1ttsv['Z1ttsv']['noivaodoan']; ?>&nbsp;
        </td>
		<td><?php echo $z1ttsv['Z1ttsv']['ngayvaodang']; ?>&nbsp;
            <?php echo $z1ttsv['Z1ttsv']['noivaodang']; ?>&nbsp;
        </td>
		<td><?php echo $z1ttsv['Z1ttsv']['truongthanhdoan']; ?>&nbsp;</td>
		<td><?php echo $z1ttsv['Z1ttsv']['created']; ?>&nbsp;</td>	
	</tr>
<?php endforeach; ?>
</tbody>    
	</table>
	<p>
	<?php
	echo $this->Paginator->counter(array(
	'format' => __('Trang %page%/%pages%, hiện có %count% mẫu tin', true)
	));
	?>	</p>

	<div class="paging">
		<?php echo $this->Paginator->prev('<< ' . __('Trước', true), array(), null, array('class'=>'disabled'));?>
	 | 	<?php echo $this->Paginator->numbers();?>
 |
		<?php echo $this->Paginator->next(__('Sau', true) . ' >>', array(), null, array('class' => 'disabled'));?>
	</div>

</div>
